package rabbitas {
	/**
	 * @author martindyrby
	 */
	public class PropertyManager {
		public var instanceManager : InstanceManager;
		
		
		private var _data : XML;
		private var _properties : Object;
		
		
		public function PropertyManager(data:XML) {
			_data = data;
			_properties = new Object();
		}
		
		public function resolveGlobalProperties() : void {
			var props:XMLList = _data.child(PropertyResolver.PROP);
			
			for(var i:int = 0; i < props.length(); i++) {
				var prop : XML = props[i];
				_properties[prop.@name] = PropertyResolver.resolveValue(prop, instanceManager);
			}
		}
		
		public function resolvePropertyByName(name : String) : * {
			RabbitLogger.debug("Property with name", "'"+name+"'", "requested");
			return _properties[name];
		}
	}
}
